package com.jiangore.controller;

import com.jiangore.entity.Member;
import com.jiangore.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Todo
 * @Author jiangtao
 * @CreateBy 2020-03-08 10:13 PM
 * @UpdateBy jiangtao
 * @Version v1.0
 */
@Controller
@RequestMapping
public class MemberController {

    @Autowired
    private IMemberService memberService;

    @RequestMapping("hello")
    @ResponseBody
    public String hello() {
        return "hello";
    }

    @GetMapping("get/{id}")
    @ResponseBody
    public Member getUser(@PathVariable int id) {
        return memberService.selectById(id);
    }

}
